import _ from "lodash";

/***************************压缩空气电气转换***************************/
// Table
export const airToPowerColumns = [
  { title: "空压站", dataIndex: "site", key: "site" },
  { title: "排气量(m³/min)", dataIndex: "outAir", key: "outAir" },
  { title: "运行时间", dataIndex: "timespan", key: "timespan" },
  { title: "产气量", dataIndex: "inAir", key: "inAir" },
  { title: "耗电能", dataIndex: "power", key: "power" },
  {
    title: "单位气量耗电(KWH/m³)",
    dataIndex: "powerByUnit",
    key: "powerByUnit",
  },
];

// Form
export const airToPowerFormItems = [
  {
    type: "hidden",
    name: "id",
  },
  {
    label: "空压站",
    type: "input",
    name: "site",
    span: 12,
    rules: [
      {
        required: true,
        message: "必填",
      },
    ],
  },
  {
    label: "排气量(m³/min)",
    type: "number",
    name: "outAir",
    span: 12,
    rules: [
      {
        required: true,
        message: "必填",
      },
    ],
  },
  {
    label: "运行时间",
    type: "number",
    name: "timespan",
    span: 12,
    rules: [
      {
        required: true,
        message: "必填",
      },
    ],
  },
  {
    label: "耗电能",
    type: "number",
    name: "power",
    span: 12,
    rules: [
      {
        required: true,
        message: "必填",
      },
    ],
  },
];
/***************************压缩空气电气转换***************************/

/***************************工序及子工序***************************/
// 工序表
export const works = [
  {
    label: "船体下料",
    value: "0",
  },
  {
    label: "船体割旧",
    value: "1",
  },
  {
    label: "船体焊接",
    value: "2",
  },
  {
    label: "机电管子焊接",
    value: "3",
    children: [
      { label: "法兰管子焊接", value: "3-0" },
      { label: "弯头管子焊接", value: "3-1" },
    ],
  },
  {
    label: "涂装喷漆",
    value: "4",
    children: [
      { label: "喷漆房分段喷漆", value: "4-0" },
      { label: "舱室及船壳喷漆", value: "4-1" },
    ],
  },
  {
    label: "涂装打砂除锈",
    value: "5",
    children: [
      { label: "打砂房分段打砂", value: "5-0" },
      { label: "舱室打砂", value: "5-1" },
    ],
  },
  {
    label: "涂装清洁超水除锈",
    value: "6",
    children: [
      { label: "超水清洁点打", value: "6-0" },
      { label: "超水清洁", value: "6-1" },
      { label: "超水除锈", value: "6-2" },
      { label: "舱盖超水除锈", value: "6-3" },
    ],
  },
];
export const flatWorks = _.reduce(
  works,
  (arr, work) => {
    arr.push({ label: work.label, value: work.value });
    if (work.children) {
      arr = arr.concat(work.children);
    }
    return arr;
  },
  []
);
export const showWorkLabel = (value) => {
  const one = _.find(flatWorks, (o) => o.value == value);
  if (one) {
    return one.label;
  } else {
    return "未知";
  }
};

// 工序一级Table
const workColumns3 = [
  {
    title: "船舶名称",
    dataIndex: "shipName",
    key: "shipName",
  },
  {
    title: "焊接长度(mm)",
    dataIndex: "length",
    key: "length",
  },
  {
    title: "焊接方式",
    dataIndex: "method",
    key: "method",
  },
  {
    title: "d(mm)",
    dataIndex: "d",
    key: "d",
  },
  {
    title: "焊缝数量",
    dataIndex: "gapNum",
    key: "gapNum",
  },
  {
    title: "设备型号",
    dataIndex: "deviceNo",
    key: "deviceNo",
  },
  {
    title: "焊接用电量(kwh)",
    dataIndex: "power",
    key: "power",
    customRender: ({ text }) => {
      return text ? text.toFixed(3) : 0;
    },
  },
  {
    title: "单位用电量(kwh/m)",
    dataIndex: "powerByUnit", // 动态计算
    key: "powerByUnit",
    customRender: ({ text }) => {
      return text ? text.toFixed(3) : 0;
    },
  },
];

const workColumns6 = [
  {
    title: "船舶名称",
    dataIndex: "shipName",
    key: "shipName",
  },
  {
    title: "面积(m²)",
    dataIndex: "area",
    key: "area",
  },
  {
    title: "耗电量(kwh)",
    dataIndex: "power", // 动态计算
    key: "power",
    customRender: ({ text }) => {
      return text ? text.toFixed(3) : 0;
    },
  },
  {
    title: "单位耗电(kwh/m)",
    dataIndex: "powerUnit", // 动态计算
    key: "powerUnit",
    customRender: ({ text }) => {
      return text ? text.toFixed(3) : 0;
    },
  },
];

export const workColumns = {
  0: [
    {
      title: "船舶名称",
      dataIndex: "shipName",
      key: "shipName",
    },
    {
      title: "切割长度(m)",
      dataIndex: "cutLength",
      key: "cutLength",
    },
    {
      title: "切割面积(m²)",
      dataIndex: "cutArea",
      key: "cutArea",
    },
    {
      title: "钢板类型",
      dataIndex: "type",
      key: "type",
    },
    {
      title: "长(mm)",
      dataIndex: "length",
      key: "length",
    },
    {
      title: "宽(mm)",
      dataIndex: "width",
      key: "width",
    },
    {
      title: "厚(mm)",
      dataIndex: "thickness",
      key: "thickness",
    },
    {
      title: "数量",
      dataIndex: "num",
      key: "num",
    },
    {
      title: "面积(m²)",
      dataIndex: "area", // 动态计算
      key: "area",
    },
    {
      title: "钢板重量(kg)",
      dataIndex: "weight", // 动态计算
      key: "weight",
    },
    {
      title: "设备/工具类型",
      dataIndex: "device",
      key: "device",
    },
    {
      title: "设备型号",
      dataIndex: "deviceNo",
      key: "deviceNo",
    },
    {
      title: "电表起始读数",
      dataIndex: "startPower",
      key: "startPower",
    },
    {
      title: "电表结束读数",
      dataIndex: "endPower",
      key: "endPower",
    },
    {
      title: "耗电量(kwh)",
      dataIndex: "power", // 动态计算
      key: "power",
      customRender: ({ text }) => {
        return text ? text.toFixed(3) : 0;
      },
    },
    {
      title: "单位耗电(kwh/m²)",
      dataIndex: "powerByUnit", // 动态计算
      key: "powerByUnit",
      customRender: ({ text }) => {
        return text ? text.toFixed(3) : 0;
      },
    },
    {
      title: "氧气起始读数",
      dataIndex: "startO2",
      key: "startO2",
    },
    {
      title: "氧气结束读数",
      dataIndex: "endO2",
      key: "endO2",
    },
    {
      title: "耗氧气量(m³)",
      dataIndex: "o2", // 动态计算
      key: "o2",
      customRender: ({ text }) => {
        return text ? text.toFixed(3) : 0;
      },
    },
    {
      title: "单位耗氧气量(m³/m²)",
      dataIndex: "o2ByUnit", // 动态计算
      key: "o2ByUnit",
      customRender: ({ text }) => {
        return text ? text.toFixed(3) : 0;
      },
    },
    {
      title: "压缩空气开始读数",
      dataIndex: "startAir",
      key: "startAir",
    },
    {
      title: "压缩空气结束读数",
      dataIndex: "endAir",
      key: "endAir",
    },
    {
      title: "耗压缩空气量(m³)",
      dataIndex: "air", // 动态计算
      key: "air",
      customRender: ({ text }) => {
        return text ? text.toFixed(3) : 0;
      },
    },
    {
      title: "单位耗压缩空气量(m³/m²)",
      dataIndex: "airByUnit", // 动态计算
      key: "airByUnit",
      customRender: ({ text }) => {
        return text ? text.toFixed(3) : 0;
      },
    },
  ],
  1: [
    {
      title: "船舶名称",
      dataIndex: "shipName",
      key: "shipName",
    },
    {
      title: "切割长度(m)",
      dataIndex: "length",
      key: "length",
    },
    {
      title: "开始时间",
      dataIndex: "startTime",
      key: "startTime",
    },
    {
      title: "结束时间",
      dataIndex: "endTime",
      key: "endTime",
    },
    {
      title: "割刀数量",
      dataIndex: "cutNum",
      key: "cutNum",
    },
    {
      title: "天然气开始读数",
      dataIndex: "startGas",
      key: "startGas",
    },
    {
      title: "天然气结束读数",
      dataIndex: "endGas",
      key: "endGas",
    },
    {
      title: "天然气量(m³)",
      dataIndex: "gas", // 动态计算
      key: "gas",
      customRender: ({ text }) => {
        return text ? text.toFixed(3) : 0;
      },
    },
    {
      title: "单位耗天然气量(m³/m)",
      dataIndex: "gasByUnit", // 动态计算
      key: "gasByUnit",
      customRender: ({ text }) => {
        return text ? text.toFixed(3) : 0;
      },
    },
    {
      title: "氧气起始读数",
      dataIndex: "startO2",
      key: "startO2",
    },
    {
      title: "氧气结束读数",
      dataIndex: "endO2",
      key: "endO2",
    },
    {
      title: "耗氧气量(m³)",
      dataIndex: "o2", // 动态计算
      key: "o2",
      customRender: ({ text }) => {
        return text ? text.toFixed(3) : 0;
      },
    },
    {
      title: "单位耗氧气量(m³/m)",
      dataIndex: "o2ByUnit", // 动态计算
      key: "o2ByUnit",
      customRender: ({ text }) => {
        return text ? text.toFixed(3) : 0;
      },
    },
  ],
  2: [
    {
      title: "船舶名称",
      dataIndex: "shipName",
      key: "shipName",
    },
    {
      title: "开始时间",
      dataIndex: "startTime",
      key: "startTime",
    },
    {
      title: "结束时间",
      dataIndex: "endTime",
      key: "endTime",
    },
    {
      title: "焊接长度(m)",
      dataIndex: "length",
      key: "length",
    },
    {
      title: "焊机数量",
      dataIndex: "machineNum",
      key: "machineNum",
    },
    {
      title: "CO2开始读数",
      dataIndex: "startCO2",
      key: "startCO2",
    },
    {
      title: "CO2结束读数",
      dataIndex: "endCO2",
      key: "endCO2",
    },
    {
      title: "CO2量",
      dataIndex: "co2", // 动态计算
      key: "co2",
      customRender: ({ text }) => {
        return text ? text.toFixed(3) : 0;
      },
    },
    {
      title: "单位用CO2量(m³/m)",
      dataIndex: "co2ByUnit", // 动态计算
      key: "co2ByUnit",
      customRender: ({ text }) => {
        return text ? text.toFixed(3) : 0;
      },
    },
    {
      title: "耗电能(kwh)",
      dataIndex: "powers", // 动态计算
      key: "powers",
      customRender: ({ text }) => {
        return text ? text.toFixed(3) : 0;
      },
    },
    {
      title: "单位耗电(KWh/m)",
      dataIndex: "powerByUnit", // 动态计算
      key: "powerByUnit",
      customRender: ({ text }) => {
        return text ? text.toFixed(3) : 0;
      },
    },
  ],
  // 机电管子焊接-法兰管子焊接Table
  "3-0": workColumns3,
  // 机电管子焊接-弯头管子焊接Table
  "3-1": workColumns3,
  // 涂装喷漆-喷漆房分段喷漆Table
  "4-0": [
    {
      title: "船舶名称",
      dataIndex: "shipName",
      key: "shipName",
    },
    {
      title: "工程项目",
      dataIndex: "project",
      key: "project",
    },
    {
      title: "油漆面积(m²)",
      dataIndex: "area",
      key: "area",
    },
    {
      title: "耗电能(kwh)",
      dataIndex: "powers", //动态计算
      key: "powers",
      customRender: ({ text }) => {
        return text ? text.toFixed(3) : 0;
      },
    },
    {
      title: "单位耗电(KWH/m²)",
      dataIndex: "powerByUnit",
      key: "powerByUnit",
      customRender: ({ text }) => {
        return text ? text.toFixed(3) : 0;
      },
    },
    {
      title: "压缩空气开始读数",
      dataIndex: "startAir",
      key: "startAir",
    },
    {
      title: "压缩空气结束读数",
      dataIndex: "endAir",
      key: "endAir",
    },
    {
      title: "耗压缩空气量(m³)",
      dataIndex: "air", //动态计算
      key: "air",
      customRender: ({ text }) => {
        return text ? text.toFixed(3) : 0;
      },
    },
    {
      title: "单位用压缩空气量(m³/m²)",
      dataIndex: "airByUnit", //动态计算
      key: "airByUnit",
      customRender: ({ text }) => {
        return text ? text.toFixed(3) : 0;
      },
    },
    {
      title: "VOCs设备耗气量(m³/h)",
      dataIndex: "gasByHour",
      key: "gasByHour",
      customRender: ({ text }) => {
        return text ? text.toFixed(3) : 0;
      },
    },
    {
      title: "天然气开始时间",
      dataIndex: "startGas",
      key: "startGas",
    },
    {
      title: "天然气结束时间",
      dataIndex: "endGas",
      key: "endGas",
    },
    {
      title: "耗天然气量(m³)",
      dataIndex: "gas", // 动态计算
      key: "gas",
      customRender: ({ text }) => {
        return text ? text.toFixed(3) : 0;
      },
    },
    {
      title: "单位耗天然气量(m³)",
      dataIndex: "gasByUnit", // 动态计算
      key: "gasByUnit",
      customRender: ({ text }) => {
        return text ? text.toFixed(3) : 0;
      },
    },
  ],
  // 涂装喷漆-舱室及船壳喷漆Table
  "4-1": [
    {
      title: "船舶名称",
      dataIndex: "shipName",
      key: "shipName",
    },
    {
      title: "油漆面积(m²)",
      dataIndex: "area",
      key: "area",
    },
    {
      title: "开始时间",
      dataIndex: "startTime",
      key: "startTime",
    },
    {
      title: "结束时间",
      dataIndex: "endTime",
      key: "endTime",
    },
    {
      title: "压缩空气开始读数",
      dataIndex: "startAir",
      key: "startAir",
    },
    {
      title: "压缩空气结束读数",
      dataIndex: "endAir",
      key: "endAir",
    },
    {
      title: "耗压缩空气量(m³)",
      dataIndex: "air", //动态计算
      key: "air",
      customRender: ({ text }) => {
        return text ? text.toFixed(3) : 0;
      },
    },
    {
      title: "单位用压缩空气量(m³/m²)",
      dataIndex: "airByUnit", //动态计算
      key: "airByUnit",
      customRender: ({ text }) => {
        return text ? text.toFixed(3) : 0;
      },
    },
  ],
  // 打砂除锈-打砂房分段打砂Table
  "5-0": [
    {
      title: "船舶名称",
      dataIndex: "shipName",
      key: "shipName",
    },
    {
      title: "打砂面积(m²)",
      dataIndex: "area",
      key: "area",
    },
    {
      title: "打砂位置",
      dataIndex: "sandPosition",
      key: "sandPosition",
    },
    {
      title: "耗电量(kwh)",
      dataIndex: "power", // 动态计算
      key: "power",
      customRender: ({ text }) => {
        return text ? text.toFixed(3) : 0;
      },
    },
    {
      title: "单位耗电(kwh/m²)",
      dataIndex: "powerByUnit", // 动态计算
      key: "powerByUnit",
      customRender: ({ text }) => {
        return text ? text.toFixed(3) : 0;
      },
    },
    {
      title: "压缩空气开始读数",
      dataIndex: "startAir",
      key: "startAir",
    },
    {
      title: "压缩空气结束读数",
      dataIndex: "endAir",
      key: "endAir",
    },
    {
      title: "耗压缩空气量(m³)",
      dataIndex: "air", // 动态计算
      key: "air",
      customRender: ({ text }) => {
        return text ? text.toFixed(3) : 0;
      },
    },
    {
      title: "单位耗压缩空气(m³/m²)",
      dataIndex: "airByUnit", // 动态计算
      key: "airByUnit",
      customRender: ({ text }) => {
        return text ? text.toFixed(3) : 0;
      },
    },
  ],
  // 打砂除锈-舱室打砂Table
  "5-1": [
    {
      title: "船舶名称",
      dataIndex: "shipName",
      key: "shipName",
    },
    {
      title: "打砂面积(m²)",
      dataIndex: "area",
      key: "area",
    },
    {
      title: "开始时间",
      dataIndex: "startTime",
      key: "startTime",
    },
    {
      title: "结束时间",
      dataIndex: "endTime",
      key: "endTime",
    },
    {
      title: "流量表起始读数",
      dataIndex: "startAir",
      key: "startAir",
    },
    {
      title: "流量表结束读数",
      dataIndex: "endAir",
      key: "endAir",
    },
    {
      title: "单个砂缸用气量",
      dataIndex: "airByOne",
      key: "airByOne",
    },
    {
      title: "砂缸数",
      dataIndex: "num",
      key: "num",
    },
    {
      title: "耗压缩空气量(m³)",
      dataIndex: "air", // 动态计算
      key: "air",
      customRender: ({ text }) => {
        return text ? text.toFixed(3) : 0;
      },
    },
    {
      title: "单位耗压缩空气(m³/m²)",
      dataIndex: "airByUnit", // 动态计算
      key: "airByUnit",
      customRender: ({ text }) => {
        return text ? text.toFixed(3) : 0;
      },
    },
  ],
  // 涂装清洁超水除锈-超水清洁点打Table
  "6-0": workColumns6,
  // 涂装清洁超水除锈-超水清洁Table
  "6-1": workColumns6,
  // 涂装清洁超水除锈-超水除锈Table
  "6-2": workColumns6,
  // 涂装清洁超水除锈-舱盖超水除锈Table
  "6-3": workColumns6,
};
// 工序二级Table
export const innerColumns = {
  2: [
    { title: "设备型号", dataIndex: "deviceNo", key: "deviceNo" },
    { title: "电表起始读数", dataIndex: "startPower", key: "startPower" },
    { title: "电表结束读数", dataIndex: "endPower", key: "endPower" },
  ],
  // 涂装喷漆-喷漆房分段喷漆-设备运行Table
  "4-0": [
    { title: "开始时间", dataIndex: "startTime", key: "startTime" },
    { title: "结束时间", dataIndex: "endTime", key: "endTime" },
    { title: "使用设备名称", dataIndex: "device", key: "device" },
    { title: "数量", dataIndex: "num", key: "num" },
    { title: "单位", dataIndex: "unit", key: "unit" },
    { title: "设备功率(kw)", dataIndex: "power", key: "power" },
    {
      title: "总有功电能",
      dataIndex: "totalPower",
      key: "totalPower",
      customRender: ({ text }) => {
        return text ? text.toFixed(3) : 0;
      },
    },
  ],
  // 打砂除锈-打砂房分段打砂-设备运行Table
  "5-0": [
    { title: "开始时间", dataIndex: "startTime", key: "startTime" },
    { title: "结束时间", dataIndex: "endTime", key: "endTime" },
    { title: "设备名称", dataIndex: "device", key: "device" },
    { title: "数量", dataIndex: "num", key: "num" },
    { title: "单位", dataIndex: "unit", key: "unit" },
    { title: "功率", dataIndex: "power", key: "power" },
    {
      title: "总有功电能",
      dataIndex: "totalPower",
      key: "totalPower",
      customRender: ({ text }) => {
        return text ? text.toFixed(3) : 0;
      },
    },
  ],
  // 涂装清洁超水除锈-超水清洁点打-设备
  "6-0": [
    { title: "设备编号", dataIndex: "deviceNo", key: "deviceNo" },
    { title: "额定功率", dataIndex: "power", key: "power" },
    { title: "使用时间", dataIndex: "timeNum", key: "timeNum" },
    {
      title: "总有功电能",
      dataIndex: "powerByHour",
      key: "powerByHour",
      customRender: ({ text }) => {
        return text ? text.toFixed(3) : 0;
      },
    },
  ],
  // 涂装清洁超水除锈-超水清洁-设备
  "6-1": [
    { title: "设备编号", dataIndex: "deviceNo", key: "deviceNo" },
    {
      title: "开始时间",
      dataIndex: "startTime",
      key: "startTime",
    },
    {
      title: "结束时间",
      dataIndex: "endTime",
      key: "endTime",
    },
    {
      title: "总有功电能",
      dataIndex: "powerByHour",
      key: "powerByHour",
      customRender: ({ text }) => {
        return text ? text.toFixed(3) : 0;
      },
    },
  ],
  // 涂装清洁超水除锈-超水除锈-设备
  "6-2": [
    { title: "设备编号", dataIndex: "deviceNo", key: "deviceNo" },
    {
      title: "开始时间",
      dataIndex: "startTime",
      key: "startTime",
    },
    {
      title: "结束时间",
      dataIndex: "endTime",
      key: "endTime",
    },
    {
      title: "总有功电能",
      dataIndex: "powerByHour",
      key: "powerByHour",
      customRender: ({ text }) => {
        return text ? text.toFixed(3) : 0;
      },
    },
  ],
  // 涂装清洁超水除锈-舱盖超水除锈-设备
  "6-3": [
    { title: "设备编号", dataIndex: "deviceNo", key: "deviceNo" },
    {
      title: "开始时间",
      dataIndex: "startTime",
      key: "startTime",
    },
    {
      title: "结束时间",
      dataIndex: "endTime",
      key: "endTime",
    },
    {
      title: "总有功电能",
      dataIndex: "powerByHour",
      key: "powerByHour",
      customRender: ({ text }) => {
        return text ? text.toFixed(3) : 0;
      },
    },
  ],
};

// 工序一级Form
const formItem3 = [
  {
    type: "hidden",
    name: "id",
  },
  {
    label: "船舶名称",
    type: "select",
    name: "shipId",
    options: [],
    span: 12,
    rules: [
      {
        required: true,
        message: "必填",
      },
    ],
  },
  {
    label: "焊接长度",
    type: "unmber",
    name: "length",
    span: 12,
    rules: [
      {
        required: true,
        message: "必填",
      },
    ],
  },
  {
    label: "焊接方式",
    type: "select",
    name: "method",
    span: 12,
    options: [
      { label: "氩弧", value: "氩弧" },
      { label: "CO2", value: "CO2" },
    ],
    rules: [
      {
        required: true,
        message: "必填",
      },
    ],
  },
  {
    label: "d(mm)",
    type: "unmber",
    name: "d",
    span: 12,
    rules: [
      {
        required: true,
        message: "必填",
      },
    ],
  },
  {
    label: "焊缝数量",
    type: "unmber",
    name: "gapNum",
    span: 12,
    rules: [
      {
        required: true,
        message: "必填",
      },
    ],
  },
  {
    label: "设备型号",
    type: "input",
    name: "deviceNo",
    span: 12,
    rules: [
      {
        required: true,
        message: "必填",
      },
    ],
  },
  {
    label: "焊接用电量(kwh)",
    type: "unmber",
    name: "power",
    span: 12,
    rules: [
      {
        required: true,
        message: "必填",
      },
    ],
  },
];

const formItem6 = [
  {
    type: "hidden",
    name: "id",
  },
  {
    label: "船舶名称",
    type: "select",
    name: "shipId",
    options: [],
    span: 12,
    rules: [
      {
        required: true,
        message: "必填",
      },
    ],
  },
  {
    label: "面积(m²)",
    type: "unmber",
    name: "area",
    span: 12,
    rules: [
      {
        required: true,
        message: "必填",
      },
    ],
  },
];

export const workFormItems = {
  0: [
    {
      type: "hidden",
      name: "id",
    },
    {
      label: "船舶名称",
      type: "select",
      name: "shipId",
      options: [],
      span: 12,
      rules: [
        {
          required: true,
          message: "必填",
        },
      ],
    },
    {
      label: "切割长度(m)",
      type: "number",
      name: "cutLength",
      span: 12,
      rules: [
        {
          required: true,
          message: "必填",
        },
      ],
    },
    {
      label: "切割面积(m²)",
      type: "number",
      name: "cutArea",
      span: 12,
      rules: [
        {
          required: true,
          message: "必填",
        },
      ],
    },
    {
      label: "钢板类型",
      type: "select",
      name: "type",
      options: [{ label: "A板", value: "A" }],
      span: 12,
      rules: [
        {
          required: true,
          message: "必填",
        },
      ],
    },
    {
      label: "长(mm)",
      type: "number",
      name: "length",
      span: 12,
      rules: [
        {
          required: true,
          message: "必填",
        },
      ],
    },
    {
      label: "宽(mm)",
      type: "number",
      name: "width",
      span: 12,
      rules: [
        {
          required: true,
          message: "必填",
        },
      ],
    },
    {
      label: "厚(mm)",
      type: "number",
      name: "thickness",
      span: 12,
      rules: [
        {
          required: true,
          message: "必填",
        },
      ],
    },
    {
      label: "数量",
      type: "number",
      name: "num",
      span: 12,
      rules: [
        {
          required: true,
          message: "必填",
        },
      ],
    },
    {
      label: "面积(m²)",
      type: "number",
      name: "area",
      span: 12,
      rules: [
        {
          required: true,
          message: "必填",
        },
      ],
    },
    {
      label: "钢板重量(kg)",
      type: "number",
      name: "weight",
      span: 12,
      rules: [
        {
          required: true,
          message: "必填",
        },
      ],
    },
    {
      label: "设备/工具类型",
      type: "input",
      name: "device",
      span: 12,
      rules: [
        {
          required: true,
          message: "必填",
        },
      ],
    },
    {
      label: "设备型号",
      type: "input",
      name: "deviceNo",
      span: 12,
      rules: [
        {
          required: true,
          message: "必填",
        },
      ],
    },
    {
      label: "电表起始读数",
      type: "number",
      name: "startPower",
      span: 12,
      rules: [
        {
          required: true,
          message: "必填",
        },
      ],
    },
    {
      label: "电表结束读数",
      type: "number",
      name: "endPower",
      span: 12,
      rules: [
        {
          required: true,
          message: "必填",
        },
      ],
    },
    {
      label: "氧气起始读数",
      type: "number",
      name: "startO2",
      span: 12,
      rules: [
        {
          required: true,
          message: "必填",
        },
      ],
    },
    {
      label: "氧气结束读数",
      type: "number",
      name: "endO2",
      span: 12,
      rules: [
        {
          required: true,
          message: "必填",
        },
      ],
    },
    {
      label: "压缩空气开始读数",
      type: "number",
      name: "startAir",
      span: 12,
      rules: [
        {
          required: true,
          message: "必填",
        },
      ],
    },
    {
      label: "压缩空气结束读数",
      type: "number",
      name: "endAir",
      span: 12,
      rules: [
        {
          required: true,
          message: "必填",
        },
      ],
    },
  ],
  1: [
    {
      type: "hidden",
      name: "id",
    },
    {
      label: "船舶名称",
      type: "select",
      name: "shipId",
      options: [],
      span: 12,
      rules: [
        {
          required: true,
          message: "必填",
        },
      ],
    },
    {
      label: "切割长度(m)",
      type: "number",
      name: "length",
      span: 12,
      rules: [
        {
          required: true,
          message: "必填",
        },
      ],
    },
    {
      label: "开始时间",
      type: "datetime",
      name: "startTime",
      span: 12,
      rules: [
        {
          required: true,
          message: "必填",
        },
      ],
    },
    {
      label: "结束时间",
      type: "datetime",
      name: "endTime",
      span: 12,
      rules: [
        {
          required: true,
          message: "必填",
        },
      ],
    },
    {
      label: "割刀数量",
      type: "number",
      name: "cutNum",
      span: 12,
      rules: [
        {
          required: true,
          message: "必填",
        },
      ],
    },
    {
      label: "天然气开始读数",
      type: "number",
      name: "startGas",
      span: 12,
      rules: [
        {
          required: true,
          message: "必填",
        },
      ],
    },
    {
      label: "天然气结束读数",
      type: "number",
      name: "endGas",
      span: 12,
      rules: [
        {
          required: true,
          message: "必填",
        },
      ],
    },
    {
      label: "氧气起始读数",
      type: "number",
      name: "startO2",
      span: 12,
      rules: [
        {
          required: true,
          message: "必填",
        },
      ],
    },
    {
      label: "氧气结束读数",
      type: "number",
      name: "endO2",
      span: 12,
      rules: [
        {
          required: true,
          message: "必填",
        },
      ],
    },
  ],
  2: [
    {
      type: "hidden",
      name: "id",
    },
    {
      label: "船舶名称",
      type: "select",
      name: "shipId",
      options: [],
      span: 12,
      rules: [
        {
          required: true,
          message: "必填",
        },
      ],
    },
    {
      label: "焊接长度(m)",
      type: "unmber",
      name: "length",
      span: 12,
      rules: [
        {
          required: true,
          message: "必填",
        },
      ],
    },
    {
      label: "开始时间",
      type: "datetime",
      name: "startTime",
      span: 12,
      rules: [
        {
          required: true,
          message: "必填",
        },
      ],
    },
    {
      label: "结束时间",
      type: "datetime",
      name: "endTime",
      span: 12,
      rules: [
        {
          required: true,
          message: "必填",
        },
      ],
    },
    {
      label: "焊机数量",
      type: "number",
      name: "machineNum",
      span: 12,
    },
    {
      label: "CO2开始读数",
      type: "number",
      name: "startCO2",
      span: 12,
      rules: [
        {
          required: true,
          message: "必填",
        },
      ],
    },
    {
      label: "CO2结束读数",
      type: "number",
      name: "endCO2",
      span: 12,
      rules: [
        {
          required: true,
          message: "必填",
        },
      ],
    },
  ],
  "3-0": formItem3,
  "3-1": formItem3,
  "4-0": [
    {
      type: "hidden",
      name: "id",
    },
    {
      label: "船舶名称",
      type: "select",
      name: "shipId",
      options: [],
      span: 12,
      rules: [
        {
          required: true,
          message: "必填",
        },
      ],
    },
    {
      label: "油漆面积(m²)",
      type: "unmber",
      name: "area",
      span: 12,
      rules: [
        {
          required: true,
          message: "必填",
        },
      ],
    },
    {
      label: "工程项目",
      type: "input",
      name: "project",
      span: 12,
      rules: [
        {
          required: true,
          message: "必填",
        },
      ],
    },
    {
      label: "压缩空气开始读数",
      type: "unmber",
      name: "startAir",
      span: 12,
      rules: [
        {
          required: true,
          message: "必填",
        },
      ],
    },
    {
      label: "压缩空气结束读数",
      type: "unmber",
      name: "endAir",
      span: 12,
      rules: [
        {
          required: true,
          message: "必填",
        },
      ],
    },
    {
      label: "天然气开始时间",
      type: "datetime",
      name: "startGas",
      span: 12,
      rules: [
        {
          required: true,
          message: "必填",
        },
      ],
    },
    {
      label: "天然气结束时间",
      type: "datetime",
      name: "endGas",
      span: 12,
      rules: [
        {
          required: true,
          message: "必填",
        },
      ],
    },
    {
      label: "VOCs设备耗气量(m³/h)",
      type: "unmber",
      name: "gasByHour",
      span: 12,
      rules: [
        {
          required: true,
          message: "必填",
        },
      ],
    },
  ],
  "4-1": [
    {
      type: "hidden",
      name: "id",
    },
    {
      label: "船舶名称",
      type: "select",
      name: "shipId",
      options: [],
      span: 12,
      rules: [
        {
          required: true,
          message: "必填",
        },
      ],
    },
    {
      label: "油漆面积(m²)",
      type: "unmber",
      name: "area",
      span: 12,
      rules: [
        {
          required: true,
          message: "必填",
        },
      ],
    },
    {
      label: "开始时间",
      type: "datetime",
      name: "startTime",
      span: 12,
      rules: [
        {
          required: true,
          message: "必填",
        },
      ],
    },
    {
      label: "结束时间",
      type: "datetime",
      name: "endTime",
      span: 12,
      rules: [
        {
          required: true,
          message: "必填",
        },
      ],
    },
    {
      label: "压缩空气开始读数",
      type: "unmber",
      name: "startAir",
      span: 12,
      rules: [
        {
          required: true,
          message: "必填",
        },
      ],
    },
    {
      label: "压缩空气结束读数",
      type: "unmber",
      name: "endAir",
      span: 12,
      rules: [
        {
          required: true,
          message: "必填",
        },
      ],
    },
  ],
  "5-0": [
    {
      type: "hidden",
      name: "id",
    },
    {
      label: "船舶名称",
      type: "select",
      name: "shipId",
      span: 12,
      rules: [
        {
          required: true,
          message: "必填",
        },
      ],
      options: [],
    },
    {
      label: "打砂面积(m²)",
      type: "number",
      name: "area",
      span: 12,
      rules: [
        {
          required: true,
          message: "必填",
        },
      ],
    },
    {
      label: "打砂位置",
      type: "input",
      name: "sandPosition",
      span: 12,
    },
    {
      label: "压缩空气开始读数",
      type: "number",
      name: "startAir",
      span: 12,
      rules: [
        {
          required: true,
          message: "必填",
        },
      ],
    },
    {
      label: "压缩空气结束读数",
      type: "number",
      name: "endAir",
      span: 12,
      rules: [
        {
          required: true,
          message: "必填",
        },
      ],
    },
  ],
  "5-1": [
    {
      type: "hidden",
      name: "id",
    },
    {
      label: "船舶名称",
      type: "select",
      name: "shipId",
      span: 12,
      rules: [
        {
          required: true,
          message: "必填",
        },
      ],
      options: [],
    },
    {
      label: "打砂面积(m²)",
      type: "number",
      name: "area",
      span: 12,
      rules: [
        {
          required: true,
          message: "必填",
        },
      ],
    },
    {
      label: "开始时间",
      type: "datetime",
      name: "startTime",
      span: 12,
      rules: [
        {
          required: true,
          message: "必填",
        },
      ],
    },
    {
      label: "结束时间",
      type: "datetime",
      name: "endTime",
      span: 12,
      rules: [
        {
          required: true,
          message: "必填",
        },
      ],
    },
    {
      label: "流量表起始读数",
      type: "number",
      name: "startAir",
      span: 12,
      rules: [
        {
          required: true,
          message: "必填",
        },
      ],
    },
    {
      label: "流量表结束读数",
      type: "number",
      name: "endAir",
      span: 12,
      rules: [
        {
          required: true,
          message: "必填",
        },
      ],
    },
    {
      label: "砂缸数",
      type: "number",
      name: "num",
      span: 12,
      rules: [
        {
          required: true,
          message: "必填",
        },
      ],
    },
  ],
  "6-0": formItem6,
  "6-1": formItem6,
  "6-2": formItem6,
  "6-3": formItem6,
};

// 工序二级Form(由某个一级Table行数据进入，所以带着行pid)
const innerForm6 = [
  {
    type: "hidden",
    name: "id",
  },
  {
    type: "hidden",
    name: "pid",
  },
  {
    label: "设备型号",
    type: "input",
    name: "deviceNo",
    span: 12,
    rules: [
      {
        required: true,
        message: "必填",
      },
    ],
  },
  {
    label: "开始时间",
    type: "datetime",
    name: "startTime",
    span: 12,
    rules: [
      {
        required: true,
        message: "必填",
      },
    ],
  },
  {
    label: "结束时间",
    type: "datetime",
    name: "endTime",
    span: 12,
    rules: [
      {
        required: true,
        message: "必填",
      },
    ],
  },
  {
    label: "总有功电能",
    type: "number",
    name: "powerByHour",
    span: 12,
    rules: [
      {
        required: true,
        message: "必填",
      },
    ],
  },
];
export const innerFormItems = {
  2: [
    {
      type: "hidden",
      name: "id",
    },
    {
      type: "hidden",
      name: "pid",
    },
    {
      label: "设备型号",
      type: "input",
      name: "deviceNo",
      span: 12,
      rules: [
        {
          required: true,
          message: "必填",
        },
      ],
    },
    {
      label: "电表起始读数",
      type: "number",
      name: "startPower",
      span: 12,
      rules: [
        {
          required: true,
          message: "必填",
        },
      ],
    },
    {
      label: "电表结束读数",
      type: "number",
      name: "endPower",
      span: 12,
      rules: [
        {
          required: true,
          message: "必填",
        },
      ],
    },
  ],
  // 涂装喷漆-喷漆房分段喷漆-设备运行Form
  "4-0": [
    {
      type: "hidden",
      name: "id",
    },
    {
      type: "hidden",
      name: "pid",
    },
    {
      label: "开始时间",
      type: "datetime",
      name: "startTime",
      span: 12,
      rules: [
        {
          required: true,
          message: "必填",
        },
      ],
    },
    {
      label: "结束时间",
      type: "datetime",
      name: "endTime",
      span: 12,
      rules: [
        {
          required: true,
          message: "必填",
        },
      ],
    },
    {
      label: "使用设备名称",
      type: "input",
      name: "device",
      span: 12,
      rules: [
        {
          required: true,
          message: "必填",
        },
      ],
    },
    {
      label: "数量",
      type: "number",
      name: "num",
      span: 12,
      rules: [
        {
          required: true,
          message: "必填",
        },
      ],
    },
    {
      label: "单位",
      type: "input",
      name: "unit",
      span: 12,
      rules: [
        {
          required: true,
          message: "必填",
        },
      ],
    },
    {
      label: "设备功率(kw)",
      type: "number",
      name: "power",
      span: 12,
      rules: [
        {
          required: true,
          message: "必填",
        },
      ],
    },
  ],
  // 打砂除锈-打砂房分段打砂-设备运行Form
  "5-0": [
    {
      type: "hidden",
      name: "id",
    },
    {
      type: "hidden",
      name: "pid",
    },
    {
      label: "开始时间",
      type: "datetime",
      name: "startTime",
      span: 12,
    },
    {
      label: "结束时间",
      type: "datetime",
      name: "endTime",
      span: 12,
    },
    {
      label: "使用设备名称",
      type: "input",
      name: "device",
      span: 12,
      rules: [
        {
          required: true,
          message: "必填",
        },
      ],
    },
    {
      label: "数量",
      type: "number",
      name: "num",
      span: 12,
      rules: [
        {
          required: true,
          message: "必填",
        },
      ],
    },
    {
      label: "单位",
      type: "input",
      name: "unit",
      span: 12,
      rules: [
        {
          required: true,
          message: "必填",
        },
      ],
    },
    {
      label: "设备功率(kw)",
      type: "number",
      name: "power",
      span: 12,
      rules: [
        {
          required: true,
          message: "必填",
        },
      ],
    },
  ],
  // 涂装清洁超水除锈-超水清洁点打-设备Form
  "6-0": [
    {
      type: "hidden",
      name: "id",
    },
    {
      type: "hidden",
      name: "pid",
    },
    {
      label: "设备型号",
      type: "input",
      name: "deviceNo",
      span: 12,
      rules: [
        {
          required: true,
          message: "必填",
        },
      ],
    },
    {
      label: "额定功率(KW)",
      type: "number",
      name: "power",
      span: 12,
      rules: [
        {
          required: true,
          message: "必填",
        },
      ],
    },
    {
      label: "使用时间(小时)",
      type: "number",
      name: "timeNum",
      span: 12,
      rules: [
        {
          required: true,
          message: "必填",
        },
      ],
    },
    {
      label: "总有功电能",
      type: "number",
      name: "powerByHour",
      span: 12,
      rules: [
        {
          required: true,
          message: "必填",
        },
      ],
    },
  ],
  // 涂装清洁超水除锈-超水清洁-设备Form
  "6-1": innerForm6,
  // 涂装清洁超水除锈-超水除锈-设备Form
  "6-2": innerForm6,
  // 涂装清洁超水除锈-舱盖超水除锈-设备Form
  "6-3": innerForm6,
};

/***************************工序及子工序***************************/
